<?php

/**
 * Input4wksForecast form base class.
 *
 * @method Input4wksForecast getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseInput4wksForecastForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'DTTIME_FORECAST_FROM' => new sfWidgetFormInputHidden(),
      'DTTIME_FORECAST_TO'   => new sfWidgetFormInputHidden(),
      'IGEOGRAPHIC_REGION'   => new sfWidgetFormInputHidden(),
      'DTSAVE_TIME'          => new sfWidgetFormDateTime(),
      'IUSER_ID'             => new sfWidgetFormInputText(),
      'ITEMP_MAX_LOWBOUND'   => new sfWidgetFormInputText(),
      'ITEMP_MAX_HIGHBOUND'  => new sfWidgetFormInputText(),
      'ITEMP_MIN_LOWBOUND'   => new sfWidgetFormInputText(),
      'ITEMP_MIN_HIGHBOUND'  => new sfWidgetFormInputText(),
      'IRAINFALL_LOWBOUND'   => new sfWidgetFormInputText(),
      'IRAINFALL_HIGHBOUND'  => new sfWidgetFormInputText(),
      'SDESC_TH'             => new sfWidgetFormTextarea(),
      'SDESC_ENG'            => new sfWidgetFormTextarea(),
      'SWARNING_TH'          => new sfWidgetFormTextarea(),
      'SWARNING_ENG'         => new sfWidgetFormTextarea(),
      'IWEATHER_TYPE'        => new sfWidgetFormInputText(),
      'ITEMPERATURE_TYPE'    => new sfWidgetFormInputText(),
      'IWAVE_TYPE'           => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'DTTIME_FORECAST_FROM' => new sfValidatorChoice(array('choices' => array($this->getObject()->getDttimeForecastFrom()), 'empty_value' => $this->getObject()->getDttimeForecastFrom(), 'required' => false)),
      'DTTIME_FORECAST_TO'   => new sfValidatorChoice(array('choices' => array($this->getObject()->getDttimeForecastTo()), 'empty_value' => $this->getObject()->getDttimeForecastTo(), 'required' => false)),
      'IGEOGRAPHIC_REGION'   => new sfValidatorChoice(array('choices' => array($this->getObject()->getIgeographicRegion()), 'empty_value' => $this->getObject()->getIgeographicRegion(), 'required' => false)),
      'DTSAVE_TIME'          => new sfValidatorDateTime(),
      'IUSER_ID'             => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'ITEMP_MAX_LOWBOUND'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ITEMP_MAX_HIGHBOUND'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ITEMP_MIN_LOWBOUND'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ITEMP_MIN_HIGHBOUND'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IRAINFALL_LOWBOUND'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IRAINFALL_HIGHBOUND'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SDESC_TH'             => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SDESC_ENG'            => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SWARNING_TH'          => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SWARNING_ENG'         => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'IWEATHER_TYPE'        => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ITEMPERATURE_TYPE'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IWAVE_TYPE'           => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('input4wks_forecast[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Input4wksForecast';
  }


}
